package com.example.dao.roleMapper;

import com.example.dto.dept.Dept;
import com.example.dto.role.Role;
import com.example.dto.user.User;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.*;

@Repository
public interface RoleMapper {
    /**
     * 查询
     * @param wide
     * @return
     */
    List<Role> selectList(Map<String, Object> wide);

    int findCount(Map<String, Object> wide);
    
    int save(@Param("role") Role role,@Param("depts") List<Dept> depts);

    void deleteAllByIdIn(@Param("ids") Set<Long> ids);

    Role findByIds(Long id);
    /**
     * 根据用户ID查询
     * @param
     * @return /
     */
    Set<Role> findByUserId(Long userId);
    
    Role findById(Long id);

    Role findByName(String name);

    List<Role> findByUserIds(Long id);

    void creat(Role resources);

    List<Role> findAll();

    List<Role> findAllRole();

    void del(Role role);

    void add(@Param("resources") Role role,@Param("depts") List<Dept> depts);

    void adds(@Param("role") Role role,@Param("depts") List<Dept> depts);

    Role findByNames(String name);

    void dele(@Param("ids") Set<Long> ids);

    void delRole(User user);

    void addRole(@Param("resources") User resources, @Param("roles")List<Role> roles);
}
